package blackhouse_server;

import java.sql.SQLException;
import java.util.List;

import blackhouse_dao.teacher_dao;
import blackhouse_entity.teacher;

public class change_teacherinfo_server
{
	private teacher_dao	tDao	= new teacher_dao();

	public List<teacher> readytinfo(String ID) throws SQLException
	{
		String sql = "SELECT * FROM teacher WHERE tCode ='" + ID + "'";
		return tDao.queryGradeByList(sql);
	}

	public boolean chanfetinfo(String ID, int age, String tgoodat,
			String tphone, String tqq, String temali, String taddress)
	{
		String sql = "UPDATE teacher SET tAge=" + age + ",tGoodAt='" + tgoodat
				+ "',tPhone='" + tphone + "',tQQ='" + tqq + "',tEmail='"
				+ temali + "',tAddress='" + taddress + "'where tCode='" + ID
				+ "'";
		return tDao.addGradeInfo(sql) > 0;
	}
}
